<span class="badge {{ badge_class }}">{{ title }}:</span>
{% for topic in topics %}
    <form method="post" action="{% url 'learn_app:toggle_public' topic.id %}">
        {% csrf_token %}
        <button type="submit">
        {% if topic.public %}切换为私有主题{% else %}切换为公开主题{% endif %}
        </button>
    </form>
    <a href="{% url 'learn_app:topic' topic.id %}" style="margin-right: 20px">•{{ topic }}</a>
    {{ topic.date_added|date:'Y-m-d;H:i' }}
    <a href="{% url 'learn_app:edit_topic' topic.id %}" class="btn btn-secondary btn-sm" style="margin-right: 20px;margin-left: 20px;">修改主题</a>
    <a href="{% url 'learn_app:del_topic' topic.id %}" class="btn btn-danger btn-sm">删除该主题</a><br>
{% empty %}
  •NO topics have been added yet.<br>
{% endfor %}